﻿using System;
using System.Reflection;
using Dsl.Ped.Common.Helpers;

namespace Dsl.Ped.Common.Extensions {

    /// <summary>
    /// Extensions of <see cref="Enum"/>
    /// </summary>
    public static class EnumExtension 
    {
        /// <summary>
        /// Localize the given enum against the dictionary in <see cref="resourceAssembly"/>
        /// </summary>
        /// <typeparam name="T">Enum type</typeparam>
        /// <param name="enum">Enum to be localized</param>
        /// <param name="resourceAssembly">Assembly containing a dictionary</param>
        /// <param name="resourceManagerBaseName">Base name of the resource manager</param>
        /// <returns>Enum localized into <see cref="string"/></returns>
        public static string Localize<T>(this T @enum, Assembly resourceAssembly, string resourceManagerBaseName)
        {
            return EnumHelper.Localize<T>(@enum, resourceAssembly, resourceManagerBaseName);
        }
    }
}
